<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="zh" class="no-js" xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta charset="UTF-8">
{#	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> #}
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>文件上传</title>
	<link rel="stylesheet" type="text/css" href="statics/css/normalize.css" />
	<link rel="stylesheet" type="text/css" href="statics/css/default.css" />
	<link rel="stylesheet" type="text/css" href="statics/css/component.css" />
	<style type="text/css">
		.submit{
			 margin-top:32px; height:40px;
		}
		.submit-b{
			 text-decoration:none;
			background:seagreen;
			color:#f2f2f2;

			padding: 10px 30px 10px 30px;
			font-size:16px;
			font-family: 微软雅黑,宋体,Arial,Helvetica,Verdana,sans-serif;
			font-weight:bold;
			border-radius:3px;

			-webkit-transition:all linear 0.30s;
			-moz-transition:all linear 0.30s;
			transition:all linear 0.30s;
		}
		.submit input:hover{
			 background:#385f9e;
		}
	</style>

	<!-- remove this if you use Modernizr -->
		<script>(function(e,t,n){var r=e.querySelectorAll("html")[0];r.className=r.className.replace(/(^|\s)no-js(\s|$)/,"$1js$2")})(document,window,0);</script>
</head>
<body>
	<div class="container">
			<div class="content">
				<div class="box">
					<form method="post" id="fileinfo" enctype="multipart/form-data" >
					<input type="file" name="file-7[]" id="file-7" class="inputfile inputfile-6" data-multiple-caption="{count} files selected" multiple />
					<label for="file-7"><span></span> <strong><svg xmlns="http://www.w3.org/2000/svg" width="20" height="17" viewBox="0 0 20 17"><path d="M10 0l-5.2 4.9h3.3v5.1h3.8v-5.1h3.3l-5.2-4.9zm9.3 11.5l-3.2-2.1h-2l3.4 2.6h-3.5c-.1 0-.2.1-.2.1l-.8 2.3h-6l-.8-2.2c-.1-.1-.1-.2-.2-.2h-3.6l3.4-2.6h-2l-3.2 2.1c-.4.3-.7 1-.6 1.5l.6 3.1c.1.5.7.9 1.2.9h16.3c.6 0 1.1-.4 1.3-.9l.6-3.1c.1-.5-.2-1.2-.7-1.5z"/></svg> 上传文件</strong></label>
				   <br />
                        {% csrf_token %}
			       <input type="checkbox" name="classify" value="物理">物理<br />
			       <input type="checkbox" name="classify" value="语文">语文<br />
			       <input type="checkbox" name="classify" value="数学" />数学<br />
			       <input type="checkbox" name="classify" value="英语" />英语<br />
			       <div class="submit">
			       <input class="submit-b" type="button" value="提交" onclick="filesubmit()">

                       <h3 id="result"></h3>
			       </div>
					</form>
				</div>
			</div>
		</div>
        <script src="/statics/js/custom-file-input.js"></script>
         <script src="/statics/js/jQuery.js"></script>
</body>

</html>
<script>
   function filesubmit() {

       var form = new FormData(document.getElementById("fileinfo"));
       $.ajaxSetup({
                data:{csrfmiddlewaretoken:'{{ csrf_token }}'},
            });
       $.ajax({
           url:"/fileload",
           type:"post",
           data:form,
           processData:false,
           contentType:false,
           success:function (data) {

               {#document.getElementById('result').innerHTML=data.result#}
               alert(data.result)
               {#confirm(data.result)#}
               {#prompt(data.result)#}
               <!--上面这三个都可以做弹框-->
               {#swal(data.result)#}
           },
       })
   }

</script>